package weblib

import (
	"github.com/gin-gonic/gin"
	"goMicro/day05/client/services"
)

func NewGinRouter(prodService services.ProdService) *gin.Engine{
	router := gin.Default()
	router.Use(InitMiddleware(prodService))
	router.Use(ErrorMiddleware())
	v1Group :=router.Group("/v1")
	{
		v1Group.Handle("POST","/prods",GetProdList)
		v1Group.Handle("GET","/prods/:pid",GetProdDetail)
	}
	return router
}